﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Web.UC
{
    public interface IConfirmDo { 
        void ConfirmDo();
    } 
    public partial class UCConfirm : System.Web.UI.UserControl
    {
        public IConfirmDo ConfirmDoPage;

        public Unit Width
        {
            set { this.popuConfirm.Width = value; }
        }
        public string Msg
        {
            set { this.popuConfirmTipMsg.Text = value; }
        }
        public void Show()
        {
            this.popuConfirm.ShowOnPageLoad = true;
            this.btnConfirmOK.Focus();

        }
        public void Hide()
        {
            this.popuConfirm.ShowOnPageLoad = false;
        }

        protected void btnConfirmOK_Click(object sender, EventArgs e)
        {
            if (ConfirmDoPage!=null) ConfirmDoPage.ConfirmDo();
        }

        protected void btnConfirmCancel_Click(object sender, EventArgs e)
        {
            this.popuConfirm.ShowOnPageLoad = false;
        }

    }
}